Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(entity): add argument ignore_not_found to ignore "not found" errors #2628

Merged
merged 3 commits into from
Mar 28, 2024

Conversation

pranav-new-relic
Copy link
Member

@pranav-new-relic pranav-new-relic commented Mar 27, 2024

New Relic Internal

Jira

Summary

This PR proposes the addition of a new attribute ignore_not_found to the newrelic_entity data source in order to "ignore" not found errors if set true in the configuration, thereby stopping automated Terraform pipelines from halting if the entity is lost, which is useful in cases when the entity abruptly expires (see original usecase proposed by the customer in #2599).

Testing

The changes have been manually verified multifold. The test cases could not be updated because they fail with an "id" not found error, since the data source fetches no entity, which we try validating (without the expectation of an error being thrown, instead).

@codecov-commenter
Copy link

codecov-commenter commented Mar 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 33.78%. Comparing base (e6a5d8e) to head (43214e8).

Files Patch % Lines
newrelic/data_source_newrelic_entity.go 0.00% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2628      +/-   ##
==========================================
+ Coverage   32.83%   33.78%   +0.95%     
==========================================
  Files          98       98              
  Lines       26872    26884      +12     
==========================================
+ Hits         8824     9084     +260     
+ Misses      17890    17600     -290     
- Partials      158      200      +42     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pranav-new-relic pranav-new-relic changed the title fix(entity): add argument ignore_not_found to ignore not found error fix(entity): add argument ignore_not_found to ignore "not found" errors Mar 27, 2024
@pranav-new-relic pranav-new-relic marked this pull request as ready for review March 28, 2024 07:54
@pranav-new-relic pranav-new-relic merged commit 5d87ded into main Mar 28, 2024
9 checks passed
@pranav-new-relic pranav-new-relic deleted the entity-ds-ignore-not-found branch March 28, 2024 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants